package Bidostar_Case;

import Bidostar_Data.Baseinfo;
import Bidostar_Page.LoginPage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;

public class PublicLogin_ByChromeCase extends Baseinfo
{
    WebDriver driver = new ChromeDriver();

    @Test(priority = 1)
    public boolean LoginCase_ByChrome_URL1()
    {
        System.setProperty("webdriver.chrome.driver", "/usr/local/bin/chromedriver");

        driver.get(Baseinfo.URL1);
        driver.manage().window().maximize();


        LoginPage lp = new LoginPage(driver);
        if (lp.PublicLogin())
        {
            logger.info("登录成功");
            return true;
        } else
        {
            logger.warn("登录失败");
            return false;
        }
    }

    @Test(priority = 2)
    public boolean LoginCase_ByChrome_URL2()
    {
        System.setProperty("webdriver.chrome.driver", "/usr/local/bin/chromedriver");
        driver.manage().window().maximize();

        driver.get(Baseinfo.URL2);

        LoginPage lp = new LoginPage(driver);
        if (lp.PublicLogin())
        {
            logger.info("登录成功");
            return true;
        } else
        {
            logger.warn("登录失败");
            return false;
        }
    }

    @Test(priority = 3)
    public boolean LoginCase_ByChrome_URL3()
    {
        System.setProperty("webdriver.chrome.driver", "/usr/local/bin/chromedriver");
        driver.manage().window().maximize();

        driver.get(Baseinfo.URL3);

        LoginPage lp = new LoginPage(driver);
        if (lp.PublicLogin())
        {
            logger.info("登录成功");
            return true;
        } else
        {
            logger.warn("登录失败");
            return false;
        }
    }

}
